package com.jxy.homepage.web.api;

import com.jxy.BBM_info.BBM;
import com.jxy.homepage.service.ArticleService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ArticleController
 *
 * @author Jxy
 * @date 2022/2/7
 * @Description 文章控制器
 */
@RestController
@RequestMapping("/api")
public class ArticleController {
    private final ArticleService article;

    public ArticleController(ArticleService article) {
        this.article = article;
    }

    @PostMapping(value = "/doArticle")
    public BBM doArticle(@RequestBody BBM bbm) {
        return article.doArticle(bbm);
    }

    @PostMapping(value = "/getArticle")
    public BBM getArticle(@RequestBody BBM bbm) {
        return article.getArticle(bbm);
    }

}
